home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / C Internet Config / IC Read Only ƒ / IC Specific Override.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-17  |  2.9 KB  |  83 lines  |  [TEXT/SPM ]

  1. /*
  2.     IC Specific Override.h
  3.     
  4.     Header file for IC Specific Override.c
  5.     
  6. */
  7.  
  8. #pragma once
  9.  
  10. #ifndef __H_IC_Specific_Override__
  11. #define __H_IC_Specific_Override__
  12.  
  13. #define kOurComponentManufacturer 'ICRo'
  14. // You must set this up appropriately. Things will not be good otherwise.
  15.  
  16. #define delegateThisCallErr 0x81234568
  17. // Return this from a component routine if you want the generic override
  18. // component to pass this call through to the captured component.
  19.  
  20. struct SharedGlobalsStruct {
  21.     Component delegate;
  22.     
  23.     // add your own shared globals here
  24.     
  25. };
  26.  
  27. typedef struct SharedGlobalsStruct SharedGlobals,* SharedGlobalsPtr;
  28.  
  29. struct GlobalsRecordStruct {
  30.     ComponentInstance self;
  31.     ComponentInstance target;
  32.     ComponentInstance delegate;
  33.     SharedGlobalsPtr shared;
  34.     
  35.     // add your own component specific globals here
  36. };
  37.  
  38. typedef struct GlobalsRecordStruct GlobalsRecord,* GlobalsPtr,** GlobalsHandle;
  39.  
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43.  
  44. // Except when otherwise noted the globals handle is locked when any of these routines are called.
  45.  
  46. pascal ComponentResult ICSOInitShared(GlobalsHandle globals);
  47. // This routine is called to init the shared globals.  If you return an error then you should make
  48. // sure your part ofthe shared globals are 'clean'.
  49.  
  50. pascal ComponentResult ICSOCleanShared(GlobalsHandle globals);
  51. // This routine is called to clean the shared globals.
  52. // WARNING:  This will never been called if you're using an old version of the Component Manager.
  53. // Workaround: If your specifics only bleeds small amounts of memory then don't worry. If your
  54. // specifics bleeds a lot of memory or other resources (such as open files) then refuse to install
  55. // with older Component Managers (I think it was fixed in v2 of the manager).
  56.  
  57. pascal ComponentResult ICSOInitGlobals(GlobalsHandle globals);
  58. // This routine inits the override specific fields of the component specific globals. If it returns an
  59. // error then the globals must be 'clean'.
  60.  
  61. pascal ComponentResult ICSOCleanGlobals(GlobalsHandle globals);
  62. // This routine cleans up the component specific globals, disposing any pointers and otherwise
  63. // releasing any allocated resources.
  64.  
  65. pascal ComponentResult ICSOCanDo(GlobalsHandle globals,short selector);
  66. // This routine is called in response to a component can do request.  You should set component result to:
  67. //   -1 if you definitely want to say that the component can't do this
  68. //     0 if you definitely want to say that the component can do this
  69. //     1 if you want to let the target decide
  70. // WARNING: These constants are quite different from the constants used by a standard
  71. // Component Manager CanDo request.
  72.  
  73. pascal ComponentFunctionUPP ICSOWhatToOverride(GlobalsHandle globals,short selector);
  74. // Return nil if you do not want to override this what.  Return a pointer to a procedure with the
  75. // appropriate signature if you do.
  76. // WARNING: globals will not necessarily be locked and may be nil!!!
  77.  
  78. #ifdef __cplusplus
  79. }
  80. #endif
  81.  
  82. #endif /* __H_IC_Specific_Override__ */
  83.